package com.example.demo.test;

/**
 * @Description TODO
 * @Author wzh
 * @Date 2022/6/14 6:00 下午
 * @Version 1.0
 */
public class Lc101 {
    public static void main(String[] args) {

    }

    public boolean isSymmetric(TreeNode root) {
        return summary(root,root);
    }

    private boolean summary(TreeNode root, TreeNode root1) {
        if(root == null && root1==null){
            return true;
        }
        if(root == null || root1 == null){
            return false;
        }
        return root.val == root1.val && summary(root.left,root1.right) && summary(root.right,root.left);
    }


}
